package net.fpeg.kotlin.msa.wordbase.dao

import net.fpeg.kotlin.msa.wordbase.entity.Word
import net.fpeg.kotlin.msa.wordbase.entity.WordUserRelation
import org.springframework.data.jpa.repository.JpaRepository
import org.springframework.data.jpa.repository.JpaSpecificationExecutor

interface WordUserRelationDao : JpaRepository<WordUserRelation, Long> {
    fun getById(id: Long): WordUserRelation?
    fun findByWordUserRelationGroup_Id(id: Long): List<WordUserRelation>
    fun findByWordUserRelationType_Id(wordUserRelationType_id: Long): List<WordUserRelation>

    fun findDistinctWordUserRelationGroupByWordInAndWordUserRelationGroup_WordUser_Id(words: Set<Word>, id: Long): Set<WordUserRelation>


}